﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;


namespace DMS.Models
{
    public class CategoryTree
    {
        public CategoryTree()
        {
            Parent = new CategoryTree();
            Children = new List<CategoryTree>();
        }
        public int CategoryId { get; set; }
        public string CategoryName { get; set; }
        public int CategoryParentId { get; set; }
        public CategoryTree Parent { get; set; }
        public List<CategoryTree> Children { get; set; }
    }
    public class CategoryObject
    {
        public CategoryObject()
        {
            CategoryChild = new List<CategoryObject>();
        }
        public string CategoryName { get; set; }
        public string CategoryDescription { get; set; }
        public int CategoryParentId { get; set; }
        public int CategoryId { get; set; }
        public bool CategoryActive { get; set; }
        public List<CategoryObject> CategoryChild { get; set; }
    }

    public class CategoryModel
    {
        public CategoryModel()
        {
            Categories = new List<SelectListItem>();
            
        }
        public int CategoryId { get; set; }
        [Required(ErrorMessage = "Bạn chưa nhập tên chuyên mục")]
        [Display(Name = "Chuyên mục")]
        public string CategoryName { get; set; }

        [Display(Name = "Mô tả")]
        public string CategoryDescription { get; set; }

        [Display(Name = "Chuyên mục cha")]
        public string CategoryParentId { get; set; }

        [Display(Name = "Trạng thái")]
        public bool CategoryActive { get; set; }

        public List<SelectListItem> Categories { get; set; }
    }
}